import Vue from 'vue'

const files = require.context("@/api/modules", true, /\.api\.js$/)

const apiObjects = files.keys().reduce((acc, key) => {
	const module = files(key);

	return {
		...acc,
		...(Object.assign({}, module.default, module))
	};
}, {});

const api = {
	...apiObjects
};
Vue.prototype.$api = api;

export default api;